API Documentation
Public Member Functions | List of all members
nkScripts::Namespace Class Referenceabstract

Holds information and allow control over a namespace in a scripting environment. More...

Public Member Functions

 Namespace (const char *name)
 
virtual ~Namespace ()
 
const char * getName () const
 
virtual NamespacegetNamespace (const char *name) const =0
 
virtual UserTypegetUserType (const char *name) const =0
 
virtual void setVar (const char *name, int value)=0
 
virtual void setObject (const char *name, const char *userTypeName, void *value)=0
 
virtual NamespacesetNamespace (const char *name)=0
 
virtual UserTypesetUserType (const char *name)=0
 
virtual FunctionsetFunc (const char *name)=0
 
virtual void shutdown ()=0
 
virtual void reset ()=0
 

Detailed Description

Holds information and allow control over a namespace in a scripting environment.

Constructor & Destructor Documentation

◆ Namespace()

nkScripts::Namespace::Namespace ( const char *  name)

Constructor.

Parameters
nameThe namespace name.

◆ ~Namespace()

virtual nkScripts::Namespace::~Namespace ( )
virtual

Destructor.

Member Function Documentation

◆ getName()

const char* nkScripts::Namespace::getName ( ) const
Returns
The namespace name.

◆ getNamespace()

virtual Namespace* nkScripts::Namespace::getNamespace ( const char *  name) const
pure virtual
Parameters
nameThe name of the sub namespace to retrieve.
Returns
The sub namespace if available, nullptr else.

◆ getUserType()

virtual UserType* nkScripts::Namespace::getUserType ( const char *  name) const
pure virtual
Parameters
nameThe name of the user type to retrieve.
Returns
The user type defined in the namespace if available, nullptr else.

◆ setVar()

virtual void nkScripts::Namespace::setVar ( const char *  name,
int  value 
)
pure virtual

Sets a variable within the namespace.

Parameters
nameThe name of the variable to set.
valueThe value it should have.

◆ setObject()

virtual void nkScripts::Namespace::setObject ( const char *  name,
const char *  userTypeName,
void *  value 
)
pure virtual

Sets an object within the namespace.

Parameters
nameThe name of the object to set.
userTypeNameThe user type name identifying the type of the object to set.
valueThe user data pointer to attach.

◆ setNamespace()

virtual Namespace* nkScripts::Namespace::setNamespace ( const char *  name)
pure virtual

Sets a sub namespace.

Parameters
nameThe name of the sub namespace to set.
Returns
The newly created namespace. External code does not own it, it should not delete it.

◆ setUserType()

virtual UserType* nkScripts::Namespace::setUserType ( const char *  name)
pure virtual

Sets a user type.

Parameters
nameThe name of the type to set.
Returns
The newly created user type. External code does not own it, it should not delete it.

◆ setFunc()

virtual Function* nkScripts::Namespace::setFunc ( const char *  name)
pure virtual

Sets a function.

Parameters
nameThe name of the sub namespace to set.
Returns
The newly created function. External code does not own it, it should not delete it.

◆ shutdown()

virtual void nkScripts::Namespace::shutdown ( )
pure virtual

Prepares the namespace for shutdown. In theory, should never be called by external code.

◆ reset()

virtual void nkScripts::Namespace::reset ( )
pure virtual

Resets the namespace, to free all sub namespaces, functions, user types set on it.


The documentation for this class was generated from the following file: